<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
	<head>
	<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>走遍福州网-管理后台</title>
		<link href="css/login/blue_page.css" rel="stylesheet" type="text/css">
	</head>
	<script language="javascript">
		if(this!=top)//不被别的页面嵌套
			top.location="<%=request.getRequestURI()%>";
	</script>
	<script language="javascript">
		function checkusername(username){
			var str=username;
			//校验登录名：只能输入5-15个字母、数字、下划线
			var Expression=/^(\w){3,15}$/; 
			var objExp=new RegExp(Expression);
			if(objExp.test(str)==true){
			   return true;
			}else{
			   return false;
			}
		}
		
		function checkepassword(password){
			var str=password;
			//校验密码：只能输入5-20个字母、数字、下划线 
			var Expression=/^(\w){3,20}$/; 
			var objExp=new RegExp(Expression);
			if(objExp.test(str)==true){
			   return true;
			}else{
			   return false;
			}
		}
		
		function check(form1){
			if(form1.username.value==""){
			   alert("请输入用户名!");form1.username.focus();return false;
			}
			if(!checkusername(form1.username.value)){
			   alert("您输入的用户名不合法!");form1.username.focus();return false;
			}
			if(form1.password.value==""){
			   alert("请输入密码!");form1.password.focus();return false;
			}
			if(!checkepassword(form1.password.value)){
			   alert("您输入的密码不合法!");form1.password.focus();return false;
			}
			return true;
		}

		var isClick="null";
		function startLogin(){
			if(!check(login))return;
			if (isClick=="null" ) {
			
			    login.submit();
			    document.all.loginButton.disabled='false';
				document.all.loginning.innerHTML='登录中...'
				isClick="";
			}
		}
	</script>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" 
		onLoad="document.all.username.focus()" class="loginPageBg">

		<table width="100%" height="100%" border="0" align="center"
			cellpadding="0" cellspacing="0">
			<tr>
				<td height="24" align="left" valign="top"></td>
			</tr>
			<tr>
				<td align="left" valign="top">
					<table width="100%" height="100%" border="0" cellpadding="0"
						cellspacing="0">
						<tr align="left" valign="top">
							<td height="74" align="left" valign="middle">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
								<img src="image/blue/login_title.gif">
							</td>
						</tr>
						<tr align="left" valign="top">
							<td height="353" align="center" valign="middle">
								<table width="362" height="182" border="0" cellspacing="0"
									background="image/blue/login_form_bg.gif"
									style="background-repeat: no-repeat">
									<tr>
										<td width="50%" height="163" align="left" valign="bottom">
											<table width="100%" border="0">
												<tr>
													<td width="21%">
														&nbsp;
													</td>
													<td width="79%" id="loginning">
														&nbsp;
													</td>
												</tr>
											</table>
										</td>
										<td width="50%" align="center" valign="middle">
											<form name="login" method="post" action="admin/login.shtml">
												<table width="163" border="0" cellpadding="5" cellspacing="1">
													<tr><td height="45">&nbsp;</td></tr>
													<tr>
														<td width="95">
															<input name="username"  type="text" size="16" style="width: 90; cursor: auto"/>
														</td>
													</tr>
													<tr>
														<td>
															<input name="password"  type="password" size="16" style="width: 90; cursor: auto" tabindex="0" onKeyDown="if(event.keyCode==13){startLogin();}"/>
														</td>
													</tr>
													<tr>
														<td align="center">
															<input name="loginButton" type="button" value="登录" onClick="startLogin()"/>
														</td>
													</tr>
												</table>
											</form>
										</td>
									</tr>
									<tr>
										<td height="18">
											&nbsp;
										</td>
										<td>
											&nbsp;
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr align="left" valign="top">
							<td align="center" valign="middle">
								&nbsp;
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td align="left" valign="top"><jsp:include page="bottom.jsp" /></td>
			</tr>
		</table>
	</body>
</html>
